<template>
  <div class="service-cell" @click="router.push({ path: service.path, query: { title: service.title } })">
    <img class="icon" :src="service.icon" />
    <span class="title">{{ service.title }}</span>
    <van-icon name="arrow"></van-icon>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router';
import { ref, useAttrs } from 'vue';
const router = useRouter();

const service = useAttrs().service

</script>

<style lang="scss" scoped>
.service-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 17px;
  margin-bottom: 17px;

  .icon {
    width: 2rem;
  }

  .title {
    margin-left: 20px;
    text-align: left;
    flex-grow: 1;

    font: {
      size: 1.1rem;
      weight: 600;
    }
  }
}
</style>
